package cn.dt70.controller;

import cn.dt70.pojo.AqbBankcard;
import cn.dt70.service.AqbBankcardService;
import cn.dt70.utils.Constants;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/bank/")
public class BankCardController {
     @Resource
     private AqbBankcardService aqbBankcardService;

    @RequestMapping("card")
    public String card() {
        return "home-register-openbankid";
    }

    /*开通账户页面*/
    @RequestMapping("openCard")
    public String open(AqbBankcard aqbBankcard, HttpSession session) {
        AqbBankcard aqbBankcard1=(AqbBankcard) session.getAttribute(Constants.USER_SESSION);
        if (aqbBankcardService.addCard(aqbBankcard1)) {
            return "usercenter";
        }
        return "home-register-openbankid";
    }
}
